package com.cn.entity;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Cacheable;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.search.annotations.DocumentId;

/**
 * 短信业务
 * @author zlei
 *
 */
@Entity
@Table(name = "smsbusiness")     
@GenericGenerator(name = "system-uuid", strategy = "uuid")
@Cacheable
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Inheritance(strategy = InheritanceType.JOINED)
public class SMSBusiness {
	
	/**
	 * id
	 */
	@Id
	@GeneratedValue(generator = "system-uuid")
	@Column(name = "smsBusinessID", length = 32)
	@DocumentId(name = "smsBusinessID")
	private String smsBusinessID;
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	/**
	 * 业务名称
	 */
	@Column(name = "smsBusinessName")
	private String smsBusinessName;
	/**
	 * 业务代码
	 */
	@Column(name="businessCode")
	private String businessCode;
	/**
	 * 业务描述
	 */
	@Column(name = "smsBusinessDesc")
	private String smsBusinessDesc;
	/**
	 * 创建时间
	 */
	@Column(name = "createDate")
	private Date createDate;
	/**
	 * 更新时间
	 */
	@Column(name = "updateDate")
	private Date updateDate;
	
	/**
	 * 业务接入号
	 */
	@Column(name = "businessJoinNum")
	private String businessJoinNum;
	/**
	 * 业务签名
	 */
	@Column(name = "businessSignature")
	private String businessSignature;

	
	/**
	 * 业务状态（开或者关）
	 * -1：测试 0：关  1：开
	 */
	@Column(name = "businessState")
	private String businessState;
	/**
	 * 用户_业务对应关系组/业务删除则用户_业务对应关系删除/延时加载
	 */
	@OneToMany(cascade = { CascadeType.ALL }, mappedBy = "smsBusiness", fetch = FetchType.LAZY)
	private List<UserBase_SMSBusiness> userBase_SMSBusinesses = new ArrayList<UserBase_SMSBusiness>();
	/**
	 * id
	 */
	public String getSmsBusinessID() {
		return smsBusinessID;
	}
	/**
	 * 业务名称
	 */
	public String getSmsBusinessName() {
		return smsBusinessName;
	}
	/**
	 * 业务描述
	 */
	public String getSmsBusinessDesc() {
		return smsBusinessDesc;
	}
	/**
	 * 创建时间
	 */
	public Date getCreateDate() {
		return createDate;
	}
	
	/**
	 * 业务代码
	 */
	public String getBusinessCode() {
		return businessCode;
	}
	/**
	 * 业务代码
	 */
	public void setBusinessCode(String businessCode) {
		this.businessCode = businessCode;
	}
	/**
	 * 业务状态
	 * @return
	 */
	public String getBusinessState() {
		return businessState;
	}
	public void setBusinessState(String businessState) {
		this.businessState = businessState;
	}
	public List<UserBase_SMSBusiness> getUserBase_SMSBusinesses() {
		return userBase_SMSBusinesses;
	}
	public void setUserBase_SMSBusinesses(
			List<UserBase_SMSBusiness> userBase_SMSBusinesses) {
		this.userBase_SMSBusinesses = userBase_SMSBusinesses;
	}
	/**
	 * 更新时间
	 */
	public Date getUpdateDate() {
		return updateDate;
	}
	/**
	 * 更新时间
	 */
	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}
	/**
	 * id
	 */
	public void setSmsBusinessID(String smsBusinessID) {
		this.smsBusinessID = smsBusinessID;
	}
	/**
	 * 业务名称
	 */
	public void setSmsBusinessName(String smsBusinessName) {
		this.smsBusinessName = smsBusinessName;
	}
	/**
	 * 业务名称
	 */
	public void setSmsBusinessDesc(String smsBusinessDesc) {
		this.smsBusinessDesc = smsBusinessDesc;
	}
	/**
	 * 构造方法
	 * @param smsBusinessID
	 * @param smsBusinessName
	 * @param businessCode
	 * @param smsBusinessDesc
	 * @param createDate
	 * @param updateDate
	 * @param businessState
	 * @param userBase_SMSBusinesses
	 */
	public SMSBusiness(String smsBusinessID, String smsBusinessName,
			String businessCode, String smsBusinessDesc, Date createDate,
			Date updateDate, String businessState,
			List<UserBase_SMSBusiness> userBase_SMSBusinesses) {
		super();
		this.smsBusinessID = smsBusinessID;
		this.smsBusinessName = smsBusinessName;
		this.businessCode = businessCode;
		this.smsBusinessDesc = smsBusinessDesc;
		this.createDate = createDate;
		this.updateDate = updateDate;
		this.businessState = businessState;
		this.userBase_SMSBusinesses = userBase_SMSBusinesses;
	}
	public SMSBusiness() {
		this.createDate = new Date();
		this.updateDate = new Date();
	}
	/**
	 * 业务接入号
	 */
	public String getBusinessJoinNum() {
		return businessJoinNum;
	}
	/**
	 * 业务签名
	 */
	public String getBusinessSignature() {
		return businessSignature;
	}
	/**
	 * 业务接入号
	 */
	public void setBusinessJoinNum(String businessJoinNum) {
		this.businessJoinNum = businessJoinNum;
	}
	/**
	 * 业务签名
	 */
	public void setBusinessSignature(String businessSignature) {
		this.businessSignature = businessSignature;
	}
	
	
	
	

}
